using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class follow_up_schedule_viewMap : EntityTypeConfiguration<follow_up_schedule_view>
    {
        public follow_up_schedule_viewMap()
        {
            // Primary Key
            this.HasKey(t => new { t.follow_up_schedule_id, t.follow_up_flag });

            // Properties
            this.Property(t => t.follow_up_schedule_id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.create_by)
                .HasMaxLength(20);

            this.Property(t => t.update_by)
                .HasMaxLength(20);

            this.Property(t => t.patient_id)
                .HasMaxLength(20);

            this.Property(t => t.follow_up_type)
                .HasMaxLength(20);

            this.Property(t => t.actual_follow_up_type)
                .HasMaxLength(20);

            this.Property(t => t.completed_flag)
                .HasMaxLength(1);

            this.Property(t => t.follow_up_flag)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.follow_up_type_en)
                .HasMaxLength(20);

            this.Property(t => t.actual_follow_up_type_en)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("follow_up_schedule_view");
            this.Property(t => t.follow_up_schedule_id).HasColumnName("follow_up_schedule_id");
            this.Property(t => t.create_time).HasColumnName("create_time");
            this.Property(t => t.create_by).HasColumnName("create_by");
            this.Property(t => t.update_time).HasColumnName("update_time");
            this.Property(t => t.update_by).HasColumnName("update_by");
            this.Property(t => t.patient_id).HasColumnName("patient_id");
            this.Property(t => t.schedule_date).HasColumnName("schedule_date");
            this.Property(t => t.follow_up_type).HasColumnName("follow_up_type");
            this.Property(t => t.actual_follow_up_type).HasColumnName("actual_follow_up_type");
            this.Property(t => t.completed_flag).HasColumnName("completed_flag");
            this.Property(t => t.actual_date).HasColumnName("actual_date");
            this.Property(t => t.status).HasColumnName("status");
            this.Property(t => t.follow_up_flag).HasColumnName("follow_up_flag");
            this.Property(t => t.follow_up_month).HasColumnName("follow_up_month");
            this.Property(t => t.follow_up_type_en).HasColumnName("follow_up_type_en");
            this.Property(t => t.actual_follow_up_type_en).HasColumnName("actual_follow_up_type_en");
        }
    }
}
